import request from './request'

// 获取当前用户的健康记录
export const getCurrentHealthRecordApi = () => request.get('/health-records/current')

// 创建健康记录
export const createHealthRecordApi = data => request.post('/health-records', data)

// 更新健康记录
export const updateHealthRecordApi = (id, data) => request.put(`/health-records/${id}`, data)

// 删除健康记录
export const deleteHealthRecordApi = id => request.delete(`/health-records/${id}`)

export const submitHealthDataApi = (data) => {
  return request({
    url: '/health-records',
    method: 'POST',
    data
  })
}

export const getHealthHistoryApi = () => {
  return request({
    url: '/health-records/history',
    method: 'GET'
  })
}

export const getHealthDataDetailApi = (id) => {
  return request({
    url: `/health-records/${id}`,
    method: 'GET'
  })
} 